#pragma once
#include <boost/asio.hpp>
#include <boost/asio/buffer.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <iostream>
#include <string>
#include <tuple>
#include <vector>
#include <type_traits>
#include <cstdlib>
#include <iomanip> // 用于 std::hex

#include "base.h"

using boost::asio::ip::tcp;
using boost::asio::buffer;

class nmea_serial {

public:
	nmea_serial();
	~nmea_serial();

	boost::asio::serial_port init(char* serial_dev, int band_rate, int data_size);
	std::string processCommas(const std::string& input);
	std::vector<std::string> process_line(const std::string& line, int& comma_count);
	void analysis_data(const std::string& line, NMEA& nmea);
	void print_data(std::string name, NMEA nmea, int gngsa_num, int gpgsv_num, int glgsv_num);

	uint8_t calculateXorChecksum(const std::string& data);
	std::string checksumToHexString(uint8_t checksum);
	
	
	
};
